//收藏的请求封装
import request from "@/utils/http.ts"

//1.添加收藏
export const addCollectAPI = (data: any) => {
    return request({
        url: 'collect/addCollect',
        method: 'post',
        data: {
            collectJobseekerId: data.collectJobseekerId,//求职者id
            collectType: data.collectType,//收藏类型
            collectJobEmployerId: data.collectJobEmployerId,//收藏对应的岗位或者企业id
        }
    })
}

//2.分页获取收藏列表
export const pageCollectAPI = (data: any) => {
    return request({
        url: 'collect/pageCollect',
        method: 'post',
        data: {
            collectJobseekerId: data.collectJobseekerId,//求职者id
            collectType: data.collectType,//收藏类型
            searchName: data.searchName,//搜索名称
        }
    })
}

//3.删除收藏
export const deleteCollectAPI = (data: any) => {
    return request({
        url: 'collect/deleteCollect',
        method: 'post',
        data: {
            collectJobseekerId: data.collectJobseekerId,//求职者id
            collectType: data.collectType,//收藏类型
            collectJobEmployerId: data.collectJobEmployerId,//收藏对应的岗位或者企业id
        }
    })
}

//4.查询收藏情况根据岗位ID
export const getCollectByJobEmployerIdAPI =(data: any) => {
    return request({
        url: 'collect/getCollectByJobEmployerId',
        method: 'post',
        data: {
            collectJobseekerId: data.collectJobseekerId,//求职者id
            collectType: data.collectType,//收藏类型
            collectJobEmployerId: data.collectJobEmployerId,//收藏对应的岗位或者企业id
        }
    })
}
